﻿function ValidateForm(validationGroup) 
{
    Page_InvalidControlToBeFocused = null;
    if (typeof(Page_Validators) == "undefined") 
    {
        return true;
    }
    var i;
    for (i = 0; i < Page_Validators.length; i++) 
    {
        ValidatorValidate(Page_Validators[i], validationGroup, null);
        if(Page_Validators[i].isvalid)
        {
            document.getElementById(Page_Validators[i].controltovalidate).style.backgroundColor="#FFFFFF";
            document.getElementById(Page_Validators[i].id).innerHTML="";
        }
        else
        {
            document.getElementById(Page_Validators[i].controltovalidate).style.backgroundColor="#ffdfe2";
            document.getElementById(Page_Validators[i].id).innerHTML="<img src='Themas/Default/img_erro_marcacao.jpg' alt='Validação' />";
        }
    }
    ValidatorUpdateIsValid();
    ValidationSummaryOnSubmit(validationGroup);

    Page_BlockSubmit = !Page_IsValid;
    return Page_IsValid;
}